import request from '@/utils/request'

// 查询某一条
export function list (params) {
  const param = Object.assign({}, params)
  delete param.current
  delete param.pageSize
  return request({
    url: `/patient/WeiXinGetPlanNodeItemPage/${params.current}/${params.pageSize}`,
    method: 'get',
    params: param
  })
}

// 查询某一条
export function readInfo (id) {
  return request({
    url: `/patient/WeiXinRead/${id}`,
    method: 'get',
    params: {}
  })
}

// 新增或更新数据
export function createOrUpdateInfo (data) {
  return request({
    url: '/patient/WeiXinCreateOrUpdate',
    method: 'post',
    data
  })
}

// 修改已读
export function updataRead (id) {
  return request({
    url: `AppPlanNodeItem/UpdateRead/${id}`,
    method: 'get',
    params: {}
  })
}

// 获取医生信息
export function doctorInfo (openId) {
  return request({
    url: `AppDoctor/read/${openId}`,
    method: 'get',
    params: {}
  })
}

// 发送验证码
export function sendCode (phone) {
  return request({
    url: `/validate/send/${phone}`,
    method: 'get',
    params: {}
  })
}

// 校验验证码
export function verificationCode (param) {
  return request({
    url: '/validate/check',
    method: 'get',
    params: param
  })
}

// 校验验证码
export function getDepartmentList () {
  return request({
    url: '/hospitalDepartment/All',
    method: 'get',
    params: {}
  })
}
